package com.dap.utils.password;

import java.security.MessageDigest;

/**
 * Created by wangmin on 2019/6/19.
 */
public abstract class SHA1Util {
    public static byte[] digest(byte[] bytes) {
        if (bytes == null || bytes.length == 0) {
            return null;
        }

        try {
            MessageDigest mdTemp = MessageDigest.getInstance("SHA1");
            mdTemp.update(bytes);
            return mdTemp.digest();
        } catch (Exception e) {
            return null;
        }
    }
}
